import { defHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';

enum FormVO {
  getusergroup = '/admin-api/bpm/user-group/page',
  getgroup = '/admin-api/bpm/user-group/get',
  createusergroup = '/admin-api/bpm/user-group/create',
  updateusergroup = '/admin-api/bpm/user-group/update',
  deleteusergroup = '/admin-api/bpm/user-group/delete',
}
// 获取用户分组分页
export const getUsergroup = (params: any) => {
  return defHttp.get<any>(
    { url: FormVO.getusergroup, params },
    { withToken: false, withUserId: true },
  );
};
export const getGroup = (params: any) => {
  return defHttp.get<any>({ url: FormVO.getgroup, params }, { withToken: false, withUserId: true });
};
export const createUsergroup = (params: any) => {
  return defHttp.post<any>({ url: FormVO.createusergroup, params });
};
export const updateUsergroup = (params: any) => {
  return defHttp.put<any>({ url: FormVO.updateusergroup, params });
};
export const deleteUsergroup = (params: any) => {
  return defHttp.delete<any>(
    {
      url: FormVO.deleteusergroup,
      params,
      headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
    },
    { joinParamsToUrl: true },
  );
};
